package com.yksj.healthtalk.ui.doctorstation;

/**
 * 成员
 * @author Administrator
 *
 */
/*public class DoctorServiceMember extends BaseFragmentActivity implements OnClickListener, OnItemClickListener,OnClickDeleteListener {
	private DoctorGroupServiceMemberAdapter adapter;
	private List<DoctorGroupMemberEntity> persons=new ArrayList<DoctorGroupMemberEntity>();
	private String SPECIAL_GROUP_ID;//群组id
	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		setContentView(R.layout.doctor_special_service);
		initTitle();
		initView();
	}

	private void initView() {
		titleLeftBtn.setOnClickListener(this);
		titleTextV.setText("成员");
		titleRightBtn2.setVisibility(View.VISIBLE);
		titleRightBtn2.setText("添加");
		titleRightBtn2.setOnClickListener(this);
		ListView listView=(ListView) findViewById(R.id.listview);
		adapter = new DoctorGroupServiceMemberAdapter(persons,this);
		listView.setAdapter(adapter);
		listView.setOnItemClickListener(this);
//		listView.setVisibility(View.VISIBLE);
		SPECIAL_GROUP_ID=getIntent().getStringExtra("SPECIAL_GROUP_ID");
		initData(SPECIAL_GROUP_ID);
	}

	private void initData(String groupId) {
		HttpRestClient.doHttpQueryGroupMember(groupId,new ObjectHttpResponseHandler() {
			@Override
			public Object onParseResponse(String content) {
				return DoctorGroupMemberEntity.parseToList(content);
			}
			private LodingFragmentDialog showLodingDialog;
			@Override
			public void onStart() {
				super.onStart();
				showLodingDialog = LodingFragmentDialog.showLodingDialog(getSupportFragmentManager(), getResources());
			}
			@Override
			public void onSuccess(Object response) {
				super.onSuccess(response);
				if(response!=null){
					adapter.onBound((List<DoctorGroupMemberEntity>) response);
				}else{
					findViewById(R.id.text_clear).setVisibility(View.VISIBLE);
				}
			}
			@Override
			public void onFinish() {
				super.onFinish();
				showLodingDialog.dismissAllowingStateLoss();
			}
			@Override
			public void onFailure(Throwable error) {
				super.onFailure(error);
				ToastUtil.showBasicErrorShortToast(getApplicationContext());
			}
		});
		
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.title_back:
			onBackPressed();
			break;
		case R.id.title_right2:
			Intent intent=new Intent(this,DoctorServiceAddMember.class);
			startActivity(intent);
			break;
		}
		
	}
	
	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position,
			long id) {
		Intent intent=new Intent(this,DoctorServiceMember.class);
		startActivity(intent);
	}
	*//**
	 * 删除成员
	 *//*
	@Override
	public void onclick(String id) {
		*//**
		 * Type=deleteSpecialPriceGroupMember
			SPECIAL_GROUP_ID 服务特殊收费人群ID
			CUSTOMER_ID 客户id
		 *//*
		HttpRestClient.doHttpDeleteGroupMember(id,SPECIAL_GROUP_ID,new AsyncHttpResponseHandler(){
			private LodingFragmentDialog showLodingDialog;
			@Override
			public void onStart() {
				super.onStart();
				showLodingDialog = LodingFragmentDialog.showLodingDialog(getSupportFragmentManager(), getResources());
			}
			@Override
			public void onFinish() {
				super.onFinish();
				showLodingDialog.dismissAllowingStateLoss();
			}
			@Override
			public void onSuccess(String content) {
				super.onSuccess(content);
				try {
					JSONObject object=new JSONObject(content);
					if(object.has("error_message")){
						ToastUtil.showBasicShortToast(getApplicationContext(), object.optString("error_message"));
					}else{
						initData(SPECIAL_GROUP_ID);
					}
				} catch (Exception e) {
					onFailure(null);
				}
			}
			@Override
			public void onFailure(Throwable error) {
				super.onFailure(error);
				ToastUtil.showBasicErrorShortToast(getApplicationContext());
			}
		});
		
	}
}*/

